import request from '@/utils/request'

// 查询项目现金流列表
export function listDealCashflow(query) {
  return request({
    url: '/cashflow/dealCashflow/list',
    method: 'get',
    params: query
  })
}
// 查询项目现金流列表-投资数据看板
export function dealCashListByBoard(query) {
  return request({
    url: '/cashflow/dealCashflow/dealCashListByBoard',
    method: 'get',
    params: query
  })
}

// 查询项目现金流列表合计
export function getDealCashflowSum(query) {
  return request({
    url: '/cashflow/dealCashflow/getSum',
    method: 'get',
    params: query
  })
}

// 投资组合查询项目现金流列表
export function findDealCashFlowList(query) {
  return request({
    url: '/cashflow/dealCashflow/DealCashFlowList',
    method: 'get',
    params: query
  })
}

// 查询项目现金流列表
export function getDealCashflowIrr(query) {
  return request({
    url: '/cashflow/dealCashflow/irr/calc',
    method: 'get',
    params: query
  })
}

// 获取预计后面6个月的流入合计和流出合计
export function getAfterSixMoney(query) {
  return request({
    url: '/cashflow/dealCashflow/getAfterSixMoney',
    method: 'get',
    params: query
  })
}

// 查询项目资金计划数据
export function dealCapitalPlan(query) {
  return request({
    url: '/cashflow/dealCashflow/capitalPlan/',
    method: 'get',
    params: query
  })
}

// 查询项目现金流详细
export function getDealCashflow(id) {
  return request({
    url: '/cashflow/dealCashflow/' + id,
    method: 'get'
  })
}

// 保存项目现金流
export function saveDealCashflow(data) {
  return request({
    url: '/cashflow/dealCashflow/save',
    method: 'post',
    data: data
  })
}

// 删除项目现金流
export function delDealCashflow(id) {
  return request({
    url: '/cashflow/dealCashflow/' + id,
    method: 'delete'
  })
}

// 导出项目现金流
export function exportDealCashflow(query) {
  return request({
    url: '/cashflow/dealCashflow/export',
    method: 'get',
    params: query
  })
}

// 查询现金流信息返回给Chart组件使用
export function cashFlowCharts(params) {
  return request({
    url: '/cashflow/dealCashflow/cashFlowCharts',
    method: 'get',
    params: params
  })
}

// 查询现金流信息返回给Chart组件使用
export function cashFlowChartsFund(params) {
  return request({
    url: '/cashflow/dealCashflow/cashFlowChartsFund',
    method: 'get',
    params: params
  })
}

// 查询现金流信息返回给Chart组件使用
export function cashFlowChartsDeal(params) {
  return request({
    url: '/cashflow/dealCashflow/cashFlowChartsDeal',
    method: 'get',
    params: params
  })
}

// 最新(发生时间)项目现金流
export function findLatestDealCashFlow(query) {
  return request({
    url: '/cashflow/dealCashflow/findLatestDealCashFlow',
    method: 'post',
    data: query
  })
}

export function getCashFlowCombined(fundId) {
  return request({
    url: '/cashflow/dealCashflow/getCashFlowCombined/' + fundId,
    method: 'get'
  })
}

export function getDealCashFlowPageThreeValue(params) {
  return request({
    url: '/cashflow/dealCashflow/getDealCashFlowPageThreeValue',
    method: 'get',
    params: params
  })
}

export function getDealCashFlowIrrHistory(dealId) {
  return request({
    url: '/cashflow/dealCashflow/getDealCashFlowIrrHistory/' + dealId,
    method: 'get'
  })
}

export function getDicts() {
  return request({
    url: '/cashflow/dealCashflow/dicts',
    method: 'get'
  })
}

export function getChart(params) {
  return request({
    url: '/cashflow/dealCashflow/getChart',
    method: 'get',
    params: params
  })
}
